From: Ewan Mellor Date: Mon, 19 Mar 2007 14:46:51 +0000 (+0000) Subject: Only import xenapi_create when using the Xen-API server -- this has additional X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15282^2~22 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0389938d6e1e0454c33e2a2f3c066f2ccefcb11d;p=xen.git Only import xenapi_create when using the Xen-API server -- this has additional dependencies that we don't want to require in legacy mode. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 6a4795d2ed..1af0fbefd7 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -35,7 +35,6 @@ from xen.xend.XendBootloader import bootloader from xen.util import blkif from xen.util import security from xen.xm.main import serverType, SERVER_XEN_API, get_single_vm -from xen.xm.xenapi_create import sxp2xml, xenapi_create from xen.xm.opts import * @@ -1249,6 +1248,7 @@ def main(argv): raise OptionError("Cannot read file %s: %s" % (config, exn[1])) if serverType == SERVER_XEN_API: + from xen.xm.xenapi_create import sxp2xml sxp2xml_inst = sxp2xml() doc = sxp2xml_inst.convert_sxp_to_xml(config, transient=True) @@ -1266,6 +1266,7 @@ def main(argv): do_console(sxp.child_value(config, 'name', -1)) if serverType == SERVER_XEN_API: + from xen.xm.xenapi_create import xenapi_create xenapi_create_inst = xenapi_create() vm_refs = xenapi_create_inst.create(document = doc)